feat: implement more friendly updater errors#1770
feat: implement more friendly updater errors#1770nmggithub wants to merge 3 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| const NETWORK_ERROR_PATTERN = | ||
| /\b(EAI_AGAIN|ECONNABORTED|ECONNREFUSED|ECONNRESET|ENETUNREACH|ENOTFOUND|ERR_CONNECTION_(?:CLOSED|REFUSED|RESET|TIMED_OUT)|ERR_INTERNET_DISCONNECTED|ERR_NAME_NOT_RESOLVED|ETIMEDOUT|socket hang up)\b/i; | ||
| const CHECKSUM_ERROR_PATTERN = |
There was a problem hiding this comment.
This is a bit over-engineered, as upstream Electron Updater should only ever have one error message, but this does make our implementation (hopefully) future-proof if they change that error message. We may also be able to key off their ERR_CHECKSUM_MISMATCH code, if we desire.
ApprovabilityVerdict: Approved This PR improves error message presentation for desktop updates by mapping cryptic errors to user-friendly messages and consolidating toast logic. The changes are additive and contained to error handling presentation without modifying core update mechanics. The only open comment is a low-severity dead code finding. You can customize Macroscope's approvability policy. Learn more. |
Dismissing prior approval to re-evaluate 838ceb4
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e3fb506. Configure here.
| return getDesktopUpdateActionError(result) !== null; | ||
| } | ||
|
|
||
| export function shouldHighlightDesktopUpdateError(state: DesktopUpdateState | null): boolean { |
There was a problem hiding this comment.
Unused exported function after removing all callers
Low Severity
shouldToastDesktopUpdateActionResult was removed from all production call sites (Sidebar.tsx and SidebarUpdatePill.tsx) in this PR, but its definition and export in desktopUpdate.logic.ts (and corresponding tests in desktopUpdate.logic.test.ts) were left behind. It's now dead code in production — only referenced by its own test file.
Reviewed by Cursor Bugbot for commit e3fb506. Configure here.
There was a problem hiding this comment.
cc: @juliusmarminge
I may have vibed too hard on this one. Let me know your thoughts on if we should remove this or add it back into the app proper.


What Changed
This condenses all our copied update state toasts to a single file, and also allows us to add action buttons to the toast from the Electron main process (over IPC). This makes the code more DRY and also gives users updating a more friendly experience when something goes wrong.
Why
Our update error toasts are unfriendly.
Example: https://x.com/asvirts/status/2040604365040300485
UI Changes
This is an example I made with our mock update server explicitly serving the wrong checksum. That's why it always fails. But you can see the "retry download" button works.
Screen.Recording.2026-04-05.at.23.22.06.mov
Checklist
Note
Medium Risk
Changes the desktop auto-update error pipeline end-to-end (Electron main process, IPC contracts, and multiple UI entry points), so regressions could affect update flows and user messaging. Logic is mostly additive and covered by new tests, but it touches a user-critical path.
Overview
Improves desktop auto-update UX by normalizing updater errors into user-friendly messages and optionally attaching a toast action (e.g. Retry download) returned from the Electron main process.
Adds
DesktopToastActionand atoastActionfield toDesktopUpdateState, propagates it through update state reducers, and wiresmain.tsto usenormalizeDesktopUpdateError()for check/download/install failures and updatererrorevents.Centralizes web UI update toasts into
desktopUpdateToast.tsand replaces duplicated inline toast logic inSidebar,SidebarUpdatePill, andSettingsPanels, including support for action buttons that trigger the correspondingwindow.desktopBridgecall.Reviewed by Cursor Bugbot for commit e3fb506. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add user-friendly error messages and retry toast actions to the desktop updater
normalizeDesktopUpdateErrorin updateErrors.ts to classify raw updater errors (network, checksum/hash mismatch, etc.) into structured objects with a user-facing message, raw message for logging, and an optionalDesktopToastAction.DesktopUpdateStatein ipc.ts with atoastActionfield, and updates all state reducers in updateMachine.ts to carry or clear this field across update lifecycle transitions.Sidebar,SidebarUpdatePill, andAboutVersionSectionwith shared helpers that surface action buttons (e.g. retry download) whentoastActionis present.bridge.downloadUpdate().Macroscope summarized e3fb506.